package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;
import java.util.List;

@TableName("t_order")
public class OrderBean {
    @TableId(value = "pk_orderId", type = IdType.AUTO)
    private Integer id;
    @TableField("o_receiverName")
    private String receiverName;
    @TableField("o_receiverAddr")
    private String receiverAddr;
    @TableField("o_receiverPhone")
    private String receiverPhone;
    @TableField("o_orderDate")
    private LocalDate orderDate = LocalDate.now();
    @TableField("o_sumPrice")
    private Integer sumPrice;
    @TableField("o_status")
    private String status = "未发货";
    @TableField(exist = false)
    private UserBean user;
    @TableField("fk_userId")
    private Integer userId;
    @TableField(exist = false)
    private List<DetailBean> detailList;

    public OrderBean() {
    }

    public OrderBean(String receiverName, String receiverAddr, String receiverPhone,  Integer userId) {
        this.receiverName = receiverName;
        this.receiverAddr = receiverAddr;
        this.receiverPhone = receiverPhone;
        this.userId = userId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getReceiverName() {
        return receiverName;
    }

    public void setReceiverName(String receiverName) {
        this.receiverName = receiverName;
    }

    public String getReceiverAddr() {
        return receiverAddr;
    }

    public void setReceiverAddr(String receiverAddr) {
        this.receiverAddr = receiverAddr;
    }

    public String getReceiverPhone() {
        return receiverPhone;
    }

    public void setReceiverPhone(String receiverPhone) {
        this.receiverPhone = receiverPhone;
    }

    public LocalDate getOrderDate() {
        return orderDate;
    }

    public void setOrderDate(LocalDate orderDate) {
        this.orderDate = orderDate;
    }

    public Integer getSumPrice() {
        return sumPrice;
    }

    public void setSumPrice(Integer sumPrice) {
        this.sumPrice = sumPrice;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public UserBean getUser() {
        return user;
    }

    public void setUser(UserBean user) {
        this.user = user;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public List<DetailBean> getDetailList() {
        return detailList;
    }

    public void setDetailList(List<DetailBean> detailList) {
        this.detailList = detailList;
    }

    @Override
    public String toString() {
        return "OrderBean{" +
                "id=" + id +
                ", receiverName='" + receiverName + '\'' +
                ", receiverAddr='" + receiverAddr + '\'' +
                ", receiverPhone='" + receiverPhone + '\'' +
                ", orderDate=" + orderDate +
                ", sumPrice=" + sumPrice +
                ", status='" + status + '\'' +
                ", user=" + user +
                ", userId=" + userId +
                ", detailList=" + detailList +
                '}' + "\n";
    }
}
